{\tt session} & A session \\
{\tt task} & A long-running asynchronous task \\
{\tt VM} & A virtual machine (or 'guest') \\
+{\tt VM\_metrics} & The metrics associated with a VM \\
{\tt host} & A physical host \\
{\tt host\_metrics} & The metrics associated with a host \\
{\tt host\_cpu} & A physical CPU \\
VIF.network & network.VIFs & one-to-many\\
host.metrics & host\_metrics.host & one-to-one\\
PIF.metrics & PIF\_metrics.PIF & one-to-one\\
+VM.metrics & VM\_metrics.VM & one-to-one\\
PIF.host & host.PIFs & one-to-many\\
PIF.network & network.PIFs & one-to-many\\
SR.VDIs & VDI.SR & many-to-one\\
$\mathit{RW}$ & {\tt auto\_power\_on} & bool & true if this VM should be started automatically after host boot \\
$\mathit{RO}_\mathit{run}$ & {\tt suspend\_VDI} & VDI ref & The VDI that a suspend image is stored on. (Only has meaning if VM is currently suspended) \\
$\mathit{RO}_\mathit{run}$ & {\tt resident\_on} & host ref & the host the VM is currently resident on \\
-$\mathit{RO}_\mathit{ins}$ & {\tt memory/static\_max} & int & Statically-set (i.e. absolute) maximum (bytes) \\
+$\mathit{RW}$ & {\tt memory/static\_max} & int & Statically-set (i.e. absolute) maximum (bytes) \\
$\mathit{RW}$ & {\tt memory/dynamic\_max} & int & Dynamic maximum (bytes) \\
-$\mathit{RO}_\mathit{run}$ & {\tt memory/actual} & int & Guest's actual usage (bytes) \\
$\mathit{RW}$ & {\tt memory/dynamic\_min} & int & Dynamic minimum (bytes) \\
-$\mathit{RO}_\mathit{ins}$ & {\tt memory/static\_min} & int & Statically-set (i.e. absolute) mininum (bytes) \\
+$\mathit{RW}$ & {\tt memory/static\_min} & int & Statically-set (i.e. absolute) mininum (bytes) \\
$\mathit{RW}$ & {\tt VCPUs/policy} & string & the name of the VCPU scheduling policy to be applied \\
-$\mathit{RW}$ & {\tt VCPUs/params} & string & string-encoded parameters passed to selected VCPU policy \\
-$\mathit{RW}$ & {\tt VCPUs/number} & int & Current number of VCPUs \\
+$\mathit{RW}$ & {\tt VCPUs/params} & (string $\rightarrow$ string) Map & configuration parameters for the selected VCPU policy \\
+$\mathit{RW}$ & {\tt VCPUs/max} & int & Max number of VCPUs \\
+$\mathit{RW}$ & {\tt VCPUs/at\_startup} & int & Boot number of VCPUs \\
+$\mathit{RO}_\mathit{ins}$ & {\tt VCPUs/number} & int & Current number of VCPUs \\
$\mathit{RO}_\mathit{run}$ & {\tt VCPUs/utilisation} & (int $\rightarrow$ float) Map & Utilisation for all of guest's current VCPUs \\
$\mathit{RW}$ & {\tt actions/after\_shutdown} & on\_normal\_exit & action to take after the guest has shutdown itself \\
$\mathit{RW}$ & {\tt actions/after\_reboot} & on\_normal\_exit & action to take after the guest has rebooted itself \\
$\mathit{RO}_\mathit{run}$ & {\tt tools\_version} & (string $\rightarrow$ string) Map & versions of installed paravirtualised drivers \\
$\mathit{RW}$ & {\tt other\_config} & (string $\rightarrow$ string) Map & additional configuration \\
$\mathit{RO}_\mathit{run}$ & {\tt is\_control\_domain} & bool & true if this is a control domain (domain 0 or a driver domain) \\
+$\mathit{RO}_\mathit{ins}$ & {\tt metrics} & VM\_metrics ref & metrics associated with this VM. \\
\hline
\end{longtable}
\subsection{Additional RPCs associated with class: VM}
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
-\subsubsection{RPC name:~get\_memory\_dynamic\_max}
+\subsubsection{RPC name:~set\_memory\_static\_max}
{\bf Overview:}
-Get the memory/dynamic\_max field of the given VM.
+Set the memory/static\_max field of the given VM.
\noindent {\bf Signature:}
-\begin{verbatim} int get_memory_dynamic_max (session_id s, VM ref self)\end{verbatim}
+\begin{verbatim} void set_memory_static_max (session_id s, VM ref self, int value)\end{verbatim}
\noindent{\bf Arguments:}
{\bf type} & {\bf name} & {\bf description} \\ \hline
{\tt VM ref } & self & reference to the object \\ \hline
+{\tt int } & value & New value to set \\ \hline
+
\end{tabular}
\vspace{0.3cm}
\noindent {\bf Return Type:}
{\tt
-int
+void
}
-value of the field
+
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
-\subsubsection{RPC name:~set\_memory\_dynamic\_max}
+\subsubsection{RPC name:~get\_memory\_dynamic\_max}
{\bf Overview:}
-Set the memory/dynamic\_max field of the given VM.
+Get the memory/dynamic\_max field of the given VM.
\noindent {\bf Signature:}
-\begin{verbatim} void set_memory_dynamic_max (session_id s, VM ref self, int value)\end{verbatim}
+\begin{verbatim} int get_memory_dynamic_max (session_id s, VM ref self)\end{verbatim}
\noindent{\bf Arguments:}
{\bf type} & {\bf name} & {\bf description} \\ \hline
{\tt VM ref } & self & reference to the object \\ \hline
-{\tt int } & value & New value to set \\ \hline
-
\end{tabular}
\vspace{0.3cm}
\noindent {\bf Return Type:}
{\tt
-void
+int
}
-
+value of the field
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
-\subsubsection{RPC name:~get\_memory\_actual}
+\subsubsection{RPC name:~set\_memory\_dynamic\_max}
{\bf Overview:}
-Get the memory/actual field of the given VM.
+Set the memory/dynamic\_max field of the given VM.
\noindent {\bf Signature:}
-\begin{verbatim} int get_memory_actual (session_id s, VM ref self)\end{verbatim}
+\begin{verbatim} void set_memory_dynamic_max (session_id s, VM ref self, int value)\end{verbatim}
\noindent{\bf Arguments:}
{\bf type} & {\bf name} & {\bf description} \\ \hline
{\tt VM ref } & self & reference to the object \\ \hline
+{\tt int } & value & New value to set \\ \hline
+
\end{tabular}
\vspace{0.3cm}
\noindent {\bf Return Type:}
{\tt
-int
+void
}
-value of the field
+
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~set\_memory\_static\_min}
+
+{\bf Overview:}
+Set the memory/static\_min field of the given VM.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} void set_memory_static_min (session_id s, VM ref self, int value)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM ref } & self & reference to the object \\ \hline
+
+{\tt int } & value & New value to set \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+void
+}
+
+
+
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
Get the VCPUs/params field of the given VM.
\noindent {\bf Signature:}
-\begin{verbatim} string get_VCPUs_params (session_id s, VM ref self)\end{verbatim}
+\begin{verbatim} ((string -> string) Map) get_VCPUs_params (session_id s, VM ref self)\end{verbatim}
\noindent{\bf Arguments:}
\noindent {\bf Return Type:}
{\tt
-string
+(string $\rightarrow$ string) Map
}
Set the VCPUs/params field of the given VM.
\noindent {\bf Signature:}
-\begin{verbatim} void set_VCPUs_params (session_id s, VM ref self, string value)\end{verbatim}
+\begin{verbatim} void set_VCPUs_params (session_id s, VM ref self, (string -> string) Map value)\end{verbatim}
\noindent{\bf Arguments:}
{\bf type} & {\bf name} & {\bf description} \\ \hline
{\tt VM ref } & self & reference to the object \\ \hline
-{\tt string } & value & New value to set \\ \hline
+{\tt (string $\rightarrow$ string) Map } & value & New value to set \\ \hline
\end{tabular}
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
-\subsubsection{RPC name:~get\_VCPUs\_number}
+\subsubsection{RPC name:~add\_to\_VCPUs\_params}
{\bf Overview:}
-Get the VCPUs/number field of the given VM.
+Add the given key-value pair to the VCPUs/params field of the given VM.
\noindent {\bf Signature:}
-\begin{verbatim} int get_VCPUs_number (session_id s, VM ref self)\end{verbatim}
+\begin{verbatim} void add_to_VCPUs_params (session_id s, VM ref self, string key, string value)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM ref } & self & reference to the object \\ \hline
+
+{\tt string } & key & Key to add \\ \hline
+
+{\tt string } & value & Value to add \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+void
+}
+
+
+
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~remove\_from\_VCPUs\_params}
+
+{\bf Overview:}
+Remove the given key and its corresponding value from the VCPUs/params
+field of the given VM. If the key is not in that Map, then do nothing.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} void remove_from_VCPUs_params (session_id s, VM ref self, string key)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM ref } & self & reference to the object \\ \hline
+
+{\tt string } & key & Key to remove \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+void
+}
+
+
+
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_VCPUs\_max}
+
+{\bf Overview:}
+Get the VCPUs/max field of the given VM.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} int get_VCPUs_max (session_id s, VM ref self)\end{verbatim}
\noindent{\bf Arguments:}
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
-\subsubsection{RPC name:~set\_VCPUs\_number}
+\subsubsection{RPC name:~set\_VCPUs\_max}
{\bf Overview:}
-Set the VCPUs/number field of the given VM.
+Set the VCPUs/max field of the given VM.
\noindent {\bf Signature:}
-\begin{verbatim} void set_VCPUs_number (session_id s, VM ref self, int value)\end{verbatim}
+\begin{verbatim} void set_VCPUs_max (session_id s, VM ref self, int value)\end{verbatim}
\noindent{\bf Arguments:}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_VCPUs\_at\_startup}
+
+{\bf Overview:}
+Get the VCPUs/at\_startup field of the given VM.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} int get_VCPUs_at_startup (session_id s, VM ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+int
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~set\_VCPUs\_at\_startup}
+
+{\bf Overview:}
+Set the VCPUs/at\_startup field of the given VM.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} void set_VCPUs_at_startup (session_id s, VM ref self, int value)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM ref } & self & reference to the object \\ \hline
+
+{\tt int } & value & New value to set \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+void
+}
+
+
+
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_VCPUs\_number}
+
+{\bf Overview:}
+Get the VCPUs/number field of the given VM.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} int get_VCPUs_number (session_id s, VM ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+int
+}
+
+
+value of the field
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
}
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_metrics}
+
+{\bf Overview:}
+Get the metrics field of the given VM.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (VM_metrics ref) get_metrics (session_id s, VM ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+VM\_metrics ref
+}
+
+
value of the field
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
+\vspace{1cm}
+\newpage
+\section{Class: VM\_metrics}
+\subsection{Fields for class: VM\_metrics}
+\begin{longtable}{|lllp{0.38\textwidth}|}
+\hline
+\multicolumn{1}{|l}{Name} & \multicolumn{3}{l|}{\bf VM\_metrics} \\
+\multicolumn{1}{|l}{Description} & \multicolumn{3}{l|}{\parbox{11cm}{\em
+The metrics associated with a VM.}} \\
+\hline
+Quals & Field & Type & Description \\
+\hline
+$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
+$\mathit{RO}_\mathit{ins}$ & {\tt VM} & VM ref & VM to which these metrics apply \\
+$\mathit{RO}_\mathit{run}$ & {\tt memory/actual} & int & Guest's actual memory (bytes) \\
+$\mathit{RO}_\mathit{run}$ & {\tt VCPUs/number} & int & Current number of VCPUs \\
+$\mathit{RO}_\mathit{run}$ & {\tt VCPUs/utilisation} & (int $\rightarrow$ float) Map & Utilisation for all of guest's current VCPUs \\
+\hline
+\end{longtable}
+\subsection{Additional RPCs associated with class: VM\_metrics}
+\subsubsection{RPC name:~get\_uuid}
+
+{\bf Overview:}
+Get the uuid field of the given VM\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} string get_uuid (session_id s, VM_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+string
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_VM}
+
+{\bf Overview:}
+Get the VM field of the given VM\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (VM ref) get_VM (session_id s, VM_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+VM ref
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_memory\_actual}
+
+{\bf Overview:}
+Get the memory/actual field of the given VM\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} int get_memory_actual (session_id s, VM_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+int
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_VCPUs\_number}
+
+{\bf Overview:}
+Get the VCPUs/number field of the given VM\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} int get_VCPUs_number (session_id s, VM_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+int
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_VCPUs\_utilisation}
+
+{\bf Overview:}
+Get the VCPUs/utilisation field of the given VM\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} ((int -> float) Map) get_VCPUs_utilisation (session_id s, VM_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+(int $\rightarrow$ float) Map
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_by\_uuid}
+
+{\bf Overview:}
+Get a reference to the VM\_metrics instance with the specified UUID.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (VM_metrics ref) get_by_uuid (session_id s, string uuid)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt string } & uuid & UUID of object to return \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+VM\_metrics ref
+}
+
+
+reference to the object
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_record}
+
+{\bf Overview:}
+Get a record containing the current state of the given VM\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (VM_metrics record) get_record (session_id s, VM_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+VM\_metrics record
+}
+
+
+all fields from the object
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+
\vspace{1cm}
\newpage
\section{Class: host}
\begin{verbatim}VM_HANDLE_INVALID(handle)\end{verbatim}
\begin{center}\rule{10em}{0.1pt}\end{center}
+\subsubsection{VM\_METRICS\_HANDLE\_INVALID}
+
+You gave an invalid VM\_metrics handle. The VM\_metrics may have recently
+been deleted. The handle parameter echoes the bad value given.
+
+\vspace{0.3cm}
+{\bf Signature:}
+\begin{verbatim}VM_METRICS_HANDLE_INVALID(handle)\end{verbatim}
+\begin{center}\rule{10em}{0.1pt}\end{center}
+
\subsubsection{VTPM\_HANDLE\_INVALID}
You gave an invalid VTPM handle. The VTPM may have recently been deleted.
#include "xen_vdi_decl.h"
#include "xen_vif_decl.h"
#include "xen_vm_decl.h"
+#include "xen_vm_metrics_decl.h"
#include "xen_vm_power_state.h"
#include "xen_vtpm_decl.h"
struct xen_host_record_opt *resident_on;
int64_t memory_static_max;
int64_t memory_dynamic_max;
- int64_t memory_actual;
int64_t memory_dynamic_min;
int64_t memory_static_min;
char *vcpus_policy;
- char *vcpus_params;
+ xen_string_string_map *vcpus_params;
+ int64_t vcpus_max;
+ int64_t vcpus_at_startup;
int64_t vcpus_number;
xen_int_float_map *vcpus_utilisation;
enum xen_on_normal_exit actions_after_shutdown;
xen_string_string_map *tools_version;
xen_string_string_map *other_config;
bool is_control_domain;
+ struct xen_vm_metrics_record_opt *metrics;
} xen_vm_record;
/**
xen_vm_get_memory_dynamic_max(xen_session *session, int64_t *result, xen_vm vm);
-/**
- * Get the memory/actual field of the given VM.
- */
-extern bool
-xen_vm_get_memory_actual(xen_session *session, int64_t *result, xen_vm vm);
-
-
/**
* Get the memory/dynamic_min field of the given VM.
*/
* Get the VCPUs/params field of the given VM.
*/
extern bool
-xen_vm_get_vcpus_params(xen_session *session, char **result, xen_vm vm);
+xen_vm_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm vm);
+
+
+/**
+ * Get the VCPUs/max field of the given VM.
+ */
+extern bool
+xen_vm_get_vcpus_max(xen_session *session, int64_t *result, xen_vm vm);
+
+
+/**
+ * Get the VCPUs/at_startup field of the given VM.
+ */
+extern bool
+xen_vm_get_vcpus_at_startup(xen_session *session, int64_t *result, xen_vm vm);
/**
xen_vm_get_is_control_domain(xen_session *session, bool *result, xen_vm vm);
+/**
+ * Get the metrics field of the given VM.
+ */
+extern bool
+xen_vm_get_metrics(xen_session *session, xen_vm_metrics *result, xen_vm vm);
+
+
/**
* Set the name/label field of the given VM.
*/
xen_vm_set_auto_power_on(xen_session *session, xen_vm vm, bool auto_power_on);
+/**
+ * Set the memory/static_max field of the given VM.
+ */
+extern bool
+xen_vm_set_memory_static_max(xen_session *session, xen_vm vm, int64_t static_max);
+
+
/**
* Set the memory/dynamic_max field of the given VM.
*/
xen_vm_set_memory_dynamic_min(xen_session *session, xen_vm vm, int64_t dynamic_min);
+/**
+ * Set the memory/static_min field of the given VM.
+ */
+extern bool
+xen_vm_set_memory_static_min(xen_session *session, xen_vm vm, int64_t static_min);
+
+
/**
* Set the VCPUs/policy field of the given VM.
*/
* Set the VCPUs/params field of the given VM.
*/
extern bool
-xen_vm_set_vcpus_params(xen_session *session, xen_vm vm, char *params);
+xen_vm_set_vcpus_params(xen_session *session, xen_vm vm, xen_string_string_map *params);
+
+
+/**
+ * Add the given key-value pair to the VCPUs/params field of the given
+ * VM.
+ */
+extern bool
+xen_vm_add_to_vcpus_params(xen_session *session, xen_vm vm, char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * VCPUs/params field of the given VM. If the key is not in that Map, then do
+ * nothing.
+ */
+extern bool
+xen_vm_remove_from_vcpus_params(xen_session *session, xen_vm vm, char *key);
+
+
+/**
+ * Set the VCPUs/max field of the given VM.
+ */
+extern bool
+xen_vm_set_vcpus_max(xen_session *session, xen_vm vm, int64_t max);
/**
- * Set the VCPUs/number field of the given VM.
+ * Set the VCPUs/at_startup field of the given VM.
*/
extern bool
-xen_vm_set_vcpus_number(xen_session *session, xen_vm vm, int64_t number);
+xen_vm_set_vcpus_at_startup(xen_session *session, xen_vm vm, int64_t at_startup);
/**
--- /dev/null
+/*
+ * Copyright (c) 2006, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef XEN_VM_METRICS_H
+#define XEN_VM_METRICS_H
+
+#include "xen_common.h"
+#include "xen_int_float_map.h"
+#include "xen_vm_decl.h"
+#include "xen_vm_metrics_decl.h"
+
+
+/*
+ * The VM_metrics class.
+ *
+ * The metrics associated with a VM.
+ */
+
+
+/**
+ * Free the given xen_vm_metrics. The given handle must have been
+ * allocated by this library.
+ */
+extern void
+xen_vm_metrics_free(xen_vm_metrics vm_metrics);
+
+
+typedef struct xen_vm_metrics_set
+{
+ size_t size;
+ xen_vm_metrics *contents[];
+} xen_vm_metrics_set;
+
+/**
+ * Allocate a xen_vm_metrics_set of the given size.
+ */
+extern xen_vm_metrics_set *
+xen_vm_metrics_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_metrics_set. The given set must have been
+ * allocated by this library.
+ */
+extern void
+xen_vm_metrics_set_free(xen_vm_metrics_set *set);
+
+
+typedef struct xen_vm_metrics_record
+{
+ xen_vm_metrics handle;
+ char *uuid;
+ struct xen_vm_record_opt *vm;
+ int64_t memory_actual;
+ int64_t vcpus_number;
+ xen_int_float_map *vcpus_utilisation;
+} xen_vm_metrics_record;
+
+/**
+ * Allocate a xen_vm_metrics_record.
+ */
+extern xen_vm_metrics_record *
+xen_vm_metrics_record_alloc(void);
+
+/**
+ * Free the given xen_vm_metrics_record, and all referenced values.
+ * The given record must have been allocated by this library.
+ */
+extern void
+xen_vm_metrics_record_free(xen_vm_metrics_record *record);
+
+
+typedef struct xen_vm_metrics_record_opt
+{
+ bool is_record;
+ union
+ {
+ xen_vm_metrics handle;
+ xen_vm_metrics_record *record;
+ } u;
+} xen_vm_metrics_record_opt;
+
+/**
+ * Allocate a xen_vm_metrics_record_opt.
+ */
+extern xen_vm_metrics_record_opt *
+xen_vm_metrics_record_opt_alloc(void);
+
+/**
+ * Free the given xen_vm_metrics_record_opt, and all referenced values.
+ * The given record_opt must have been allocated by this library.
+ */
+extern void
+xen_vm_metrics_record_opt_free(xen_vm_metrics_record_opt *record_opt);
+
+
+typedef struct xen_vm_metrics_record_set
+{
+ size_t size;
+ xen_vm_metrics_record *contents[];
+} xen_vm_metrics_record_set;
+
+/**
+ * Allocate a xen_vm_metrics_record_set of the given size.
+ */
+extern xen_vm_metrics_record_set *
+xen_vm_metrics_record_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_metrics_record_set, and all referenced values.
+ * The given set must have been allocated by this library.
+ */
+extern void
+xen_vm_metrics_record_set_free(xen_vm_metrics_record_set *set);
+
+
+
+typedef struct xen_vm_metrics_record_opt_set
+{
+ size_t size;
+ xen_vm_metrics_record_opt *contents[];
+} xen_vm_metrics_record_opt_set;
+
+/**
+ * Allocate a xen_vm_metrics_record_opt_set of the given size.
+ */
+extern xen_vm_metrics_record_opt_set *
+xen_vm_metrics_record_opt_set_alloc(size_t size);
+
+/**
+ * Free the given xen_vm_metrics_record_opt_set, and all referenced
+ * values. The given set must have been allocated by this library.
+ */
+extern void
+xen_vm_metrics_record_opt_set_free(xen_vm_metrics_record_opt_set *set);
+
+
+/**
+ * Get a record containing the current state of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_record(xen_session *session, xen_vm_metrics_record **result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get a reference to the VM_metrics instance with the specified UUID.
+ */
+extern bool
+xen_vm_metrics_get_by_uuid(xen_session *session, xen_vm_metrics *result, char *uuid);
+
+
+/**
+ * Get the uuid field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_uuid(xen_session *session, char **result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the VM field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_vm(xen_session *session, xen_vm *result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the memory/actual field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_memory_actual(xen_session *session, int64_t *result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the VCPUs/number field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_vcpus_number(xen_session *session, int64_t *result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the VCPUs/utilisation field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_vcpus_utilisation(xen_session *session, xen_int_float_map **result, xen_vm_metrics vm_metrics);
+
+
+#endif
--- /dev/null
+/*
+ * Copyright (c) 2006, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef XEN_VM_METRICS_DECL_H
+#define XEN_VM_METRICS_DECL_H
+
+typedef void *xen_vm_metrics;
+
+struct xen_vm_metrics_set;
+struct xen_vm_metrics_record;
+struct xen_vm_metrics_record_set;
+struct xen_vm_metrics_record_opt;
+struct xen_vm_metrics_record_opt_set;
+
+#endif
#include "xen_vdi.h"
#include "xen_vif.h"
#include "xen_vm.h"
+#include "xen_vm_metrics.h"
#include "xen_vm_power_state_internal.h"
#include "xen_vtpm.h"
{ .key = "memory_dynamic_max",
.type = &abstract_type_int,
.offset = offsetof(xen_vm_record, memory_dynamic_max) },
- { .key = "memory_actual",
- .type = &abstract_type_int,
- .offset = offsetof(xen_vm_record, memory_actual) },
{ .key = "memory_dynamic_min",
.type = &abstract_type_int,
.offset = offsetof(xen_vm_record, memory_dynamic_min) },
.type = &abstract_type_string,
.offset = offsetof(xen_vm_record, vcpus_policy) },
{ .key = "VCPUs_params",
- .type = &abstract_type_string,
+ .type = &abstract_type_string_string_map,
.offset = offsetof(xen_vm_record, vcpus_params) },
+ { .key = "VCPUs_max",
+ .type = &abstract_type_int,
+ .offset = offsetof(xen_vm_record, vcpus_max) },
+ { .key = "VCPUs_at_startup",
+ .type = &abstract_type_int,
+ .offset = offsetof(xen_vm_record, vcpus_at_startup) },
{ .key = "VCPUs_number",
.type = &abstract_type_int,
.offset = offsetof(xen_vm_record, vcpus_number) },
.offset = offsetof(xen_vm_record, other_config) },
{ .key = "is_control_domain",
.type = &abstract_type_bool,
- .offset = offsetof(xen_vm_record, is_control_domain) }
+ .offset = offsetof(xen_vm_record, is_control_domain) },
+ { .key = "metrics",
+ .type = &abstract_type_ref,
+ .offset = offsetof(xen_vm_record, metrics) }
};
const abstract_type xen_vm_record_abstract_type_ =
xen_vdi_record_opt_free(record->suspend_vdi);
xen_host_record_opt_free(record->resident_on);
free(record->vcpus_policy);
- free(record->vcpus_params);
+ xen_string_string_map_free(record->vcpus_params);
xen_int_float_map_free(record->vcpus_utilisation);
xen_console_record_opt_set_free(record->consoles);
xen_vif_record_opt_set_free(record->vifs);
free(record->pci_bus);
xen_string_string_map_free(record->tools_version);
xen_string_string_map_free(record->other_config);
+ xen_vm_metrics_record_opt_free(record->metrics);
free(record);
}
bool
-xen_vm_get_memory_actual(xen_session *session, int64_t *result, xen_vm vm)
+xen_vm_get_memory_dynamic_min(xen_session *session, int64_t *result, xen_vm vm)
{
abstract_value param_values[] =
{
abstract_type result_type = abstract_type_int;
- XEN_CALL_("VM.get_memory_actual");
+ XEN_CALL_("VM.get_memory_dynamic_min");
return session->ok;
}
bool
-xen_vm_get_memory_dynamic_min(xen_session *session, int64_t *result, xen_vm vm)
+xen_vm_get_memory_static_min(xen_session *session, int64_t *result, xen_vm vm)
{
abstract_value param_values[] =
{
abstract_type result_type = abstract_type_int;
- XEN_CALL_("VM.get_memory_dynamic_min");
+ XEN_CALL_("VM.get_memory_static_min");
return session->ok;
}
bool
-xen_vm_get_memory_static_min(xen_session *session, int64_t *result, xen_vm vm)
+xen_vm_get_vcpus_policy(xen_session *session, char **result, xen_vm vm)
{
abstract_value param_values[] =
{
.u.string_val = vm }
};
- abstract_type result_type = abstract_type_int;
+ abstract_type result_type = abstract_type_string;
- XEN_CALL_("VM.get_memory_static_min");
+ *result = NULL;
+ XEN_CALL_("VM.get_VCPUs_policy");
return session->ok;
}
bool
-xen_vm_get_vcpus_policy(xen_session *session, char **result, xen_vm vm)
+xen_vm_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm vm)
{
abstract_value param_values[] =
{
.u.string_val = vm }
};
- abstract_type result_type = abstract_type_string;
+ abstract_type result_type = abstract_type_string_string_map;
*result = NULL;
- XEN_CALL_("VM.get_VCPUs_policy");
+ XEN_CALL_("VM.get_VCPUs_params");
return session->ok;
}
bool
-xen_vm_get_vcpus_params(xen_session *session, char **result, xen_vm vm)
+xen_vm_get_vcpus_max(xen_session *session, int64_t *result, xen_vm vm)
{
abstract_value param_values[] =
{
.u.string_val = vm }
};
- abstract_type result_type = abstract_type_string;
+ abstract_type result_type = abstract_type_int;
- *result = NULL;
- XEN_CALL_("VM.get_VCPUs_params");
+ XEN_CALL_("VM.get_VCPUs_max");
+ return session->ok;
+}
+
+
+bool
+xen_vm_get_vcpus_at_startup(xen_session *session, int64_t *result, xen_vm vm)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm }
+ };
+
+ abstract_type result_type = abstract_type_int;
+
+ XEN_CALL_("VM.get_VCPUs_at_startup");
return session->ok;
}
}
+bool
+xen_vm_get_metrics(xen_session *session, xen_vm_metrics *result, xen_vm vm)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm }
+ };
+
+ abstract_type result_type = abstract_type_string;
+
+ *result = NULL;
+ XEN_CALL_("VM.get_metrics");
+ return session->ok;
+}
+
+
bool
xen_vm_set_name_label(xen_session *session, xen_vm vm, char *label)
{
}
+bool
+xen_vm_set_memory_static_max(xen_session *session, xen_vm vm, int64_t static_max)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm },
+ { .type = &abstract_type_int,
+ .u.int_val = static_max }
+ };
+
+ xen_call_(session, "VM.set_memory_static_max", param_values, 2, NULL, NULL);
+ return session->ok;
+}
+
+
bool
xen_vm_set_memory_dynamic_max(xen_session *session, xen_vm vm, int64_t dynamic_max)
{
}
+bool
+xen_vm_set_memory_static_min(xen_session *session, xen_vm vm, int64_t static_min)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm },
+ { .type = &abstract_type_int,
+ .u.int_val = static_min }
+ };
+
+ xen_call_(session, "VM.set_memory_static_min", param_values, 2, NULL, NULL);
+ return session->ok;
+}
+
+
bool
xen_vm_set_vcpus_policy(xen_session *session, xen_vm vm, char *policy)
{
bool
-xen_vm_set_vcpus_params(xen_session *session, xen_vm vm, char *params)
+xen_vm_set_vcpus_params(xen_session *session, xen_vm vm, xen_string_string_map *params)
{
abstract_value param_values[] =
{
{ .type = &abstract_type_string,
.u.string_val = vm },
- { .type = &abstract_type_string,
- .u.string_val = params }
+ { .type = &abstract_type_string_string_map,
+ .u.set_val = (arbitrary_set *)params }
};
xen_call_(session, "VM.set_VCPUs_params", param_values, 2, NULL, NULL);
bool
-xen_vm_set_vcpus_number(xen_session *session, xen_vm vm, int64_t number)
+xen_vm_add_to_vcpus_params(xen_session *session, xen_vm vm, char *key, char *value)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm },
+ { .type = &abstract_type_string,
+ .u.string_val = key },
+ { .type = &abstract_type_string,
+ .u.string_val = value }
+ };
+
+ xen_call_(session, "VM.add_to_VCPUs_params", param_values, 3, NULL, NULL);
+ return session->ok;
+}
+
+
+bool
+xen_vm_remove_from_vcpus_params(xen_session *session, xen_vm vm, char *key)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm },
+ { .type = &abstract_type_string,
+ .u.string_val = key }
+ };
+
+ xen_call_(session, "VM.remove_from_VCPUs_params", param_values, 2, NULL, NULL);
+ return session->ok;
+}
+
+
+bool
+xen_vm_set_vcpus_max(xen_session *session, xen_vm vm, int64_t max)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm },
+ { .type = &abstract_type_int,
+ .u.int_val = max }
+ };
+
+ xen_call_(session, "VM.set_VCPUs_max", param_values, 2, NULL, NULL);
+ return session->ok;
+}
+
+
+bool
+xen_vm_set_vcpus_at_startup(xen_session *session, xen_vm vm, int64_t at_startup)
{
abstract_value param_values[] =
{
{ .type = &abstract_type_string,
.u.string_val = vm },
{ .type = &abstract_type_int,
- .u.int_val = number }
+ .u.int_val = at_startup }
};
- xen_call_(session, "VM.set_VCPUs_number", param_values, 2, NULL, NULL);
+ xen_call_(session, "VM.set_VCPUs_at_startup", param_values, 2, NULL, NULL);
return session->ok;
}
--- /dev/null
+/*
+ * Copyright (c) 2006, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+#include <stddef.h>
+#include <stdlib.h>
+
+#include "xen_common.h"
+#include "xen_int_float_map.h"
+#include "xen_internal.h"
+#include "xen_vm.h"
+#include "xen_vm_metrics.h"
+
+
+XEN_FREE(xen_vm_metrics)
+XEN_SET_ALLOC_FREE(xen_vm_metrics)
+XEN_ALLOC(xen_vm_metrics_record)
+XEN_SET_ALLOC_FREE(xen_vm_metrics_record)
+XEN_ALLOC(xen_vm_metrics_record_opt)
+XEN_RECORD_OPT_FREE(xen_vm_metrics)
+XEN_SET_ALLOC_FREE(xen_vm_metrics_record_opt)
+
+
+static const struct_member xen_vm_metrics_record_struct_members[] =
+ {
+ { .key = "uuid",
+ .type = &abstract_type_string,
+ .offset = offsetof(xen_vm_metrics_record, uuid) },
+ { .key = "VM",
+ .type = &abstract_type_ref,
+ .offset = offsetof(xen_vm_metrics_record, vm) },
+ { .key = "memory_actual",
+ .type = &abstract_type_int,
+ .offset = offsetof(xen_vm_metrics_record, memory_actual) },
+ { .key = "VCPUs_number",
+ .type = &abstract_type_int,
+ .offset = offsetof(xen_vm_metrics_record, vcpus_number) },
+ { .key = "VCPUs_utilisation",
+ .type = &abstract_type_int_float_map,
+ .offset = offsetof(xen_vm_metrics_record, vcpus_utilisation) }
+ };
+
+const abstract_type xen_vm_metrics_record_abstract_type_ =
+ {
+ .typename = STRUCT,
+ .struct_size = sizeof(xen_vm_metrics_record),
+ .member_count =
+ sizeof(xen_vm_metrics_record_struct_members) / sizeof(struct_member),
+ .members = xen_vm_metrics_record_struct_members
+ };
+
+
+void
+xen_vm_metrics_record_free(xen_vm_metrics_record *record)
+{
+ if (record == NULL)
+ {
+ return;
+ }
+ free(record->handle);
+ free(record->uuid);
+ xen_vm_record_opt_free(record->vm);
+ xen_int_float_map_free(record->vcpus_utilisation);
+ free(record);
+}
+
+
+bool
+xen_vm_metrics_get_record(xen_session *session, xen_vm_metrics_record **result, xen_vm_metrics vm_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm_metrics }
+ };
+
+ abstract_type result_type = xen_vm_metrics_record_abstract_type_;
+
+ *result = NULL;
+ XEN_CALL_("VM_metrics.get_record");
+
+ if (session->ok)
+ {
+ (*result)->handle = xen_strdup_((*result)->uuid);
+ }
+
+ return session->ok;
+}
+
+
+bool
+xen_vm_metrics_get_by_uuid(xen_session *session, xen_vm_metrics *result, char *uuid)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = uuid }
+ };
+
+ abstract_type result_type = abstract_type_string;
+
+ *result = NULL;
+ XEN_CALL_("VM_metrics.get_by_uuid");
+ return session->ok;
+}
+
+
+bool
+xen_vm_metrics_get_vm(xen_session *session, xen_vm *result, xen_vm_metrics vm_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm_metrics }
+ };
+
+ abstract_type result_type = abstract_type_string;
+
+ *result = NULL;
+ XEN_CALL_("VM_metrics.get_VM");
+ return session->ok;
+}
+
+
+bool
+xen_vm_metrics_get_memory_actual(xen_session *session, int64_t *result, xen_vm_metrics vm_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm_metrics }
+ };
+
+ abstract_type result_type = abstract_type_int;
+
+ XEN_CALL_("VM_metrics.get_memory_actual");
+ return session->ok;
+}
+
+
+bool
+xen_vm_metrics_get_vcpus_number(xen_session *session, int64_t *result, xen_vm_metrics vm_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm_metrics }
+ };
+
+ abstract_type result_type = abstract_type_int;
+
+ XEN_CALL_("VM_metrics.get_VCPUs_number");
+ return session->ok;
+}
+
+
+bool
+xen_vm_metrics_get_vcpus_utilisation(xen_session *session, xen_int_float_map **result, xen_vm_metrics vm_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm_metrics }
+ };
+
+ abstract_type result_type = abstract_type_int_float_map;
+
+ *result = NULL;
+ XEN_CALL_("VM_metrics.get_VCPUs_utilisation");
+ return session->ok;
+}
+
+
+bool
+xen_vm_metrics_get_uuid(xen_session *session, char **result, xen_vm_metrics vm_metrics)
+{
+ *result = session->ok ? xen_strdup_((char *)vm_metrics) : NULL;
+ return session->ok;
+}
*/
static xen_vm create_new_vm(xen_session *session)
{
+ xen_string_string_map *vcpus_params = xen_string_string_map_alloc(1);
xen_vm_record vm_record =
{
.name_label = "NewVM",
.memory_dynamic_min = 128,
.memory_static_min = 128,
.vcpus_policy = "credit",
- .vcpus_params = "",
+ .vcpus_params = vcpus_params,
.vcpus_number = 2,
.actions_after_shutdown = XEN_ON_NORMAL_EXIT_DESTROY,
.actions_after_reboot = XEN_ON_NORMAL_EXIT_RESTART,
msgid ""
msgstr ""
"Project-Id-Version: Xen-xm 3.0\n"
-"PO-Revision-Date: 2007-01-30 12:49+0000\n"
+"PO-Revision-Date: 2007-01-30 17:15+0000\n"
"Last-Translator: Ewan Mellor <ewan@xensource.com>\n"
"Language-Team: xen-devel <xen-devel@lists.xensource.com>\n"
"MIME-Version: 1.0\n"
msgid "VM_HANDLE_INVALID"
msgstr "The VM handle %(1)s is invalid."
+msgid "VM_METRICS_HANDLE_INVALID"
+msgstr "The VM_metrics handle %(1)s is invalid."
+
msgid "VTPM_HANDLE_INVALID"
msgstr "The VTPM handle %(1)s is invalid."